#frontDoor {
  --front-gold: #dbc18d;
  --front-paper: #fff1cb;
  --front-edge: clamp(10px, 1.6vw, 28px);
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: var(--front-edge);
  color: var(--front-paper);
  background-color: #18231f;
  background-image: linear-gradient(90deg, #0b1514d9 0%, #111c19b3 28%, #16211d63 46%, #18211a00 72%),
    linear-gradient(0deg, #080e0ecd 0%, transparent 24%, transparent 83%, #0e171730 100%),
    url("출정 성루.webp");
  background-position: center, center, 58% center;
  background-size: cover;
  background-repeat: no-repeat;
}
#frontDoor .front-stage {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
  padding: clamp(40px, 6vh, 82px) clamp(34px, 7.6vw, 154px);
  border: 1px solid #d8bc863e;
}
#frontDoor .front-stage::before, #frontDoor .front-stage::after {
  content: "";
  position: absolute;
  width: clamp(14px, 2vw, 30px);
  height: clamp(14px, 2vw, 30px);
  pointer-events: none;
}
#frontDoor .front-stage::before { top: -1px; left: -1px; border-top: 2px solid #c8a977; border-left: 2px solid #c8a977; }
#frontDoor .front-stage::after { bottom: -1px; right: -1px; border-bottom: 2px solid #c8a977; border-right: 2px solid #c8a977; }
#frontDoor .title-screen {
  width: max-content;
  max-width: 100%;
  text-align: center;
}
#frontDoor #gameTitle { display: grid; justify-items: start; gap: 10px; margin: 0; font-family: var(--display); }
#frontDoor .title-seal {
  display: inline-block;
  margin-left: .25em;
  padding: .22em .35em .19em .45em;
  border: 1px solid #d58a63;
  border-radius: 2px 3px 2px 1px;
  box-shadow: inset 0 0 0 2px #853728, inset 0 0 0 3px #da8d66;
  transform: rotate(-3deg);
  background: #933c2b;
  color: #fff1cc;
  font-size: clamp(18px, 1.55vw, 29px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .08em;
}
#frontDoor .title-name {
  display: block;
  padding-right: .045em;
  color: #f9e3b2;
  font-size: clamp(78px, 8.6vw, 160px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: .015em;
  white-space: nowrap;
  text-shadow: 0 2px #926c43, 0 4px #382c22, 0 7px 24px #050a08;
}
#frontDoor .start-game {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  min-width: clamp(192px, 15.5vw, 260px);
  min-height: clamp(54px, 4.5vw, 74px);
  margin-top: clamp(36px, 6.2vh, 66px);
  padding: 8px 22px;
  border: 1px solid #d4aa6a;
  border-radius: 2px;
  background: linear-gradient(150deg, #aa4d33, #7e3024 78%);
  color: #fff0cc;
  box-shadow: inset 0 0 0 3px #80382b, inset 0 0 0 4px #c68756, 0 4px 0 #3d2119, 0 9px 16px #0a100da8;
  font: 700 clamp(21px, 1.6vw, 29px)/1.2 var(--display);
  letter-spacing: -.05em;
  cursor: pointer;
}
#frontDoor .start-arrow, #frontDoor .difficulty-arrow { color: #edc887; font: 400 28px/1 var(--sans); }
#frontDoor .start-game:active { transform: translateY(2px); }
#frontDoor .title-guide { display: block; margin: 9px auto 0; min-height: 40px; padding: 4px 12px; border: 0; background: transparent; color: #efdeb4; font: 600 14px/1.4 var(--sans); text-decoration: underline; text-underline-offset: 4px; text-shadow: 0 2px 4px #09120d; }
#frontDoor .difficulty-screen { width: min(100%, clamp(340px, 37vw, 540px)); }
#frontDoor .title-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0 0 10px -3px;
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: #e5d9bc;
  font: 600 14px/1.3 var(--sans);
  text-shadow: 0 2px 6px #08100b;
}
#frontDoor #difficultyTitle { margin: 0; color: var(--front-paper); font: 700 clamp(38px, 4vw, 65px)/1.23 var(--display); letter-spacing: -.085em; text-shadow: 0 2px 9px #10150e; }
#frontDoor #difficultyTitle:focus { outline: 0; }
#frontDoor #difficultyHelp { margin: 11px 0 clamp(21px, 3.5vh, 36px); color: #e0deca; font-size: clamp(13px, 1.1vw, 17px); word-break: keep-all; text-shadow: 0 2px 5px #09100c; }
#frontDoor .difficulty-choices { display: grid; gap: 8px; }
#frontDoor .difficulty-option {
  --rank-color: #9fb289;
  display: grid;
  grid-template-columns: clamp(52px, 4.5vw, 69px) 1fr 24px;
  align-items: center;
  gap: clamp(13px, 1.6vw, 22px);
  min-height: clamp(72px, 6.8vw, 94px);
  min-width: 0;
  padding: 7px clamp(13px, 1.7vw, 25px) 7px 12px;
  border: 1px solid #8d8162;
  border-left: 4px solid var(--rank-color);
  border-radius: 2px;
  background: linear-gradient(98deg, #2c3429fa, #1b231ef2 76%, #232821eb);
  box-shadow: 0 3px 9px #0b100b42;
  color: var(--front-paper);
  text-align: left;
}
#frontDoor .difficulty-option[data-difficulty="normal"] { --rank-color: #cfac68; }
#frontDoor .difficulty-option[data-difficulty="hard"] { --rank-color: #d78f6f; }
#frontDoor .difficulty-option img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
}
#frontDoor .difficulty-copy { display: grid; align-items: center; justify-items: start; gap: 3px; }
#frontDoor .difficulty-copy strong { font: 700 clamp(21px, 1.7vw, 29px)/1.2 var(--display); letter-spacing: -.055em; }
#frontDoor .difficulty-copy > span { color: #d5d6bf; font-size: 13px; line-height: 1.5; }
#frontDoor .difficulty-copy b { margin-left: 3px; color: #f4deb3; font-variant-numeric: tabular-nums; }
#frontDoor .difficulty-arrow { justify-self: end; }
#frontDoor button:focus-visible { outline: 3px solid #ffe5a5; outline-offset: 4px; }
@media (hover: hover) {
  #frontDoor .start-game:hover { background: linear-gradient(150deg, #bd603e, #95432d 78%); }
  #frontDoor .title-back:hover { color: #fff1c9; text-decoration: underline; text-underline-offset: 4px; }
  #frontDoor .difficulty-option:hover { border-color: #e5c285; border-left-color: var(--rank-color); background: linear-gradient(98deg, #3e4533fb, #2c3428f5 76%, #353b2bed); }
}
@media (max-width: 700px) and (orientation: portrait) {
  #frontDoor {
    background-image: linear-gradient(0deg, #0d1615f5 0%, #0c1513e6 19%, #13201ba1 42%, #15201b24 69%, transparent 100%),
      url("출정 성루.webp");
    background-position: center, 90% center;
  }
  #frontDoor .front-stage { align-items: end; padding: 32px clamp(17px, 6vw, 42px) clamp(35px, 8vh, 78px); }
  #frontDoor .title-screen { justify-self: center; }
  #frontDoor #gameTitle { gap: 7px; }
  #frontDoor .title-name { font-size: clamp(48px, 18.6vw, 106px); }
  #frontDoor .start-game { min-height: 53px; min-width: 184px; margin-top: clamp(24px, 4.6vh, 45px); }
  #frontDoor[data-step="difficulty"] { background-image: linear-gradient(0deg, #0d1615fa 0%, #101b18ee 34%, #101918ad 62%, #18221d1c 100%), url("출정 성루.webp"); }
  #frontDoor .difficulty-screen { width: min(100%, 425px); justify-self: center; }
  #frontDoor .difficulty-option { min-height: 66px; grid-template-columns: 53px 1fr 19px; padding-block: 4px; }
  #frontDoor .title-back { margin-bottom: 4px; }
  #frontDoor #difficultyHelp { margin: 6px 0 17px; font-size: 13px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  #frontDoor { --front-edge: 8px; }
  #frontDoor .front-stage { padding: 10px clamp(28px, 7vw, 110px); }
  #frontDoor #gameTitle { gap: 4px; }
  #frontDoor .title-name { font-size: clamp(58px, 16vh, 86px); }
  #frontDoor .start-game { min-height: 45px; margin-top: 20px; }
  #frontDoor .title-back { min-height: 34px; margin-bottom: 0; }
  #frontDoor #difficultyTitle { font-size: 32px; }
  #frontDoor #difficultyHelp { margin: 2px 0 9px; font-size: 12px; }
  #frontDoor .difficulty-choices { gap: 4px; }
  #frontDoor .difficulty-option { grid-template-columns: 38px 1fr 15px; min-height: 46px; padding-block: 2px; }
  #frontDoor .difficulty-copy { grid-template-columns: auto 1fr; gap: 13px; }
  #frontDoor .difficulty-copy strong { font-size: 19px; }
}
@media (prefers-reduced-motion: no-preference) {
  #frontDoor .difficulty-screen:not([hidden]) { animation: front-reveal .24s ease-out both; }
  #frontDoor .start-game, #frontDoor .difficulty-arrow { transition: transform .16s ease; }
  #frontDoor .difficulty-option:is(:hover, :focus-visible) .difficulty-arrow { transform: translateX(3px); }
  @keyframes front-reveal { from { transform: translateY(7px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
}
